<template>
  <div class="rechargeRecord">
    <el-form :model="searchForm" class="searchForm">
      <el-form-item>
        <el-input class="seech0" placeholder="订单编号/用户昵称/手机号"></el-input>
      </el-form-item>

      <el-form-item>
        <el-input placeholder="车牌号" class="seech"></el-input>
      </el-form-item>

      <el-form-item>
        <el-select class="seech" v-model="searchForm.tradeType" placeholder="充值类型">
          <el-option label="入账" :value="0"></el-option>
          <el-option label="出账" :value="1"></el-option>
          <el-option label="不限" :value="null"></el-option>
        </el-select>
      </el-form-item>

      <el-form-item style="width: 380px;">
        <el-date-picker :unlink-panels="true" v-model="searchForm.date" @change="getDate" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="充值开始日期"  end-placeholder="充值结束日期">
        </el-date-picker>
      </el-form-item>

      <el-form-item style="width: 60px;">
        <el-button type="primary">搜索</el-button>
      </el-form-item>
    </el-form>

    <div class="contentTop">
      <div class="balance"> 账户余额： <span class="money">￥{{balance}}</span> 元</div>
    </div>

    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="rechargeId" label="订单编号" align="center">
      </el-table-column>
      <el-table-column prop="userName" label="用户昵称" align="center">
      </el-table-column>
      <el-table-column prop="mobilePhone" label="联系方式" align="center">
      </el-table-column>
      <el-table-column prop="carCardNum" label="绑定车牌号" align="center">
      </el-table-column>
      <el-table-column prop="rechargeType" label="充值类型" align="center">
      </el-table-column>
      <el-table-column prop="amount" label="充值金额(元)" align="center">
      </el-table-column>
      <el-table-column prop="buyTime" label="充值时间" align="center">
      </el-table-column>
      <!-- <el-table-column prop="tradeType" label="充值内容" align="center">
      </el-table-column> -->
    </el-table>

  </div>
</template>

<script>
  export default {
    name: 'rechargeRecord',
    data() {
      return {
        searchForm: {
          current: 1,
          size: 10
        },
        balance: 0,
        tableData: []
      }
    },
    mounted() {
      this.getTableData();
    },
    methods: {
      getTableData() {
        this.$axios({
          method: 'post',
          url: '/cRechargerecord/vipRechargeRecord',
          data: this.searchForm
        }).then((res) => {
          this.tableData = res.data.pageInfo.records;
        })
      },
      getDate(e) {
        // this.searchData.tradeTimeStart = e[0];
        // this.searchData.tradeTimeEnd = e[1]
      },
    }
  }
</script>

<style scoped>
  .rechargeRecord {
    padding: 10px;
  }
  .searchForm .el-form-item {
    display: inline-block;
  }
  .searchForm .seech0 {
    width: 200px;
    margin-right: 20px;
  }
  .searchForm .seech {
    width: 110px;
    margin-right: 20px;
  }
  .balance {
    display: inline-block;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #eee;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 20px;
  }
  .money {
    color: red;
    font-size: 18px;
  }



</style>
